package com.capgemini.wechat.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.capgemini.remind.pojo.CodeValue;
import com.capgemini.wechat.mapper.VehicleMapper;

/**
 * 
 * @author
 * @date
 */
@Service
@Transactional
public class VehicleService {
	@Autowired
	private VehicleMapper vehicleMapper;

	public List<CodeValue> queryVehicleBrandByDealer(String dealerId) {
		return vehicleMapper.queryVehicleBrandByDealer(dealerId);
	}

	public List<CodeValue> prepareVehicleBrandForDealer(String dealerId, List<CodeValue> commonsCodeValue) {
    	List<CodeValue> vehicleBrands = queryVehicleBrandByDealer(dealerId);
    	if(null != vehicleBrands) {
    		vehicleBrands.removeAll(commonsCodeValue);
    	}
    	commonsCodeValue.addAll(vehicleBrands);

    	return commonsCodeValue;
	}
}
